@import '~antd/lib/style/themes/default.less';

@layout-header-height: 50px;

// @nav-header-height: @layout-header-height;
// 2020-3-4 增加底部版本号的高度
@nav-header-height: 50px;
// 2020-3-9 
// 底部版本号 30
// 头像、名字、部门、职位 83
// 消息、公告等图标 56
// 分割线 2
// 50+30+83+56+2=221
// 50+30+83+52+2=217
// 50+83+52+2=187
// 50+83+1=93
@nav-header-height: 93px;

.logo {
  position: relative;
  height: 50px;
  line-height: 3;
  text-align: center;
  // padding-left: (@menu-collapsed-width - 32px) / 2;
  overflow: hidden;
  // height: @nav-header-height;
  // line-height: @nav-header-height;
  background: rgba(27, 68, 163, 1);
  transition: all 0.3s;

  img {
    display: inline-block;
    height: 40px;
    vertical-align: middle;
  }

  h1 {
    display: inline-block;
    margin: 0 0 0 12px;
    color: white;
    font-weight: 600;
    font-size: 20px;
    font-family: Avenir, 'Helvetica Neue', Arial, Helvetica, sans-serif;
    vertical-align: middle;
  }
}

.sider {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35);

  &.fixSiderBar {
    position: fixed;
    top: 0;
    left: 0;
    box-shadow: 2px 0 8px 0 rgba(29, 35, 41, 0.05);

    :global {
      .ant-menu-root {
        height:~'calc(100vh - @{nav-header-height})';
        overflow-y: auto;
      }

      .ant-menu-inline {
        border-right: 0;

        .ant-menu-item,
        .ant-menu-submenu-title {
          width: 100%;
        }
      }
    }
  }

  &.light {
    background-color: white;
    box-shadow: 2px 0 8px 0 rgba(29, 35, 41, 0.05);

    .logo {
      background: white;
      box-shadow: 1px 1px 0 0 @border-color-split;

      h1 {
        color: @primary-color;
      }
    }

    :global(.ant-menu-light) {
      border-right-color: transparent;
    }
  }
}

.icon {
  width: 14px;
  vertical-align: baseline;
}

.headBadge {
  padding: 3px;
  cursor: pointer;

  .headIcon {
    font-size: 18px;
    color: #ddd;

    &:hover {
      transform: scale(1.2);
      transition: all 0.3s;
    }
  }

  :global {
    .ant-badge-count {
      min-width: 16px;
      height: 16px;
      padding: 2px;
      font-size: 9px;
      border-radius: 3px;
      box-shadow: none;
      line-height: normal;
    }
  }
}

:global {
  .top-nav-menu li.ant-menu-item {
    height: @nav-header-height;
    line-height: @nav-header-height;
  }

  .drawer .drawer-content {
    background: #001529;
  }

  // 暗黑主题，改为渐变色
  .ant-menu-dark,
  .ant-menu-dark .ant-menu-sub {
    background: linear-gradient(180deg, rgba(28, 76, 195, 1) 0%, rgba(28, 76, 195, 1) 0%, rgba(14, 54, 154, 1) 100%, rgba(14, 54, 154, 1) 100%);
  }

  // 跟随父级背景颜色
  .ant-menu-dark .ant-menu-inline.ant-menu-sub {
    background-color: transparent;
    // background-color: rgb(33, 90, 223);
    box-shadow: none;
  }

  .ant-menu-inline-collapsed {

    &>.ant-menu-item .sider-menu-item-img+span,
    &>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-item .sider-menu-item-img+span,
    &>.ant-menu-submenu>.ant-menu-submenu-title .sider-menu-item-img+span {
      display: inline-block;
      max-width: 0;
      opacity: 0;
    }
  }

  .ant-menu-item .sider-menu-item-img+span,
  .ant-menu-submenu-title .sider-menu-item-img+span {
    opacity: 1;
    transition: opacity 0.3s @ease-in-out, width 0.3s @ease-in-out;
  }

  .ant-drawer-left {
    .ant-drawer-body {
      padding: 0;
    }
  }
}